from typing import Optional
from sqlmodel import Field
from sqlmodel import SQLModel, create_engine, Session, select, JSON
from sqlalchemy.dialects.mysql import BLOB

class Task(SQLModel, table=True):
    id: Optional[str] = Field(default=None, primary_key=True)
    next_run_time: float = Field(default=None, nullable=True)
    job_state: bytes
    trigger: str = Field(default=None, nullable=True)
    title: str = Field(default=None, nullable=True)
    kwargs: dict = Field(sa_type=JSON, default=None)
    __tablename__ = "apscheduler_jobs"
